package com.sh.data.engine.application.model.request.normalization;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Pattern;

/**
 * @author: mingxi.xpb
 * @description:
 * @date: 2022/1/6 18:17
 */
@Data
@Schema
public class SaveThemeRequest {

    /*主题id*/
    @Schema(description = "主题id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long themeId;

    /*主题名称*/
    @Schema(description = "主题名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @Pattern(
        regexp = "^[a-zA-Z0-9_\\u4e00-\\u9fa5]{2,32}$",
        message = "主题名长度为2~32个字符，仅支持中文、英文字母、数字和下划线")
    private String themeName;

    /*描述*/
    @Schema(title = "描述")
    @Pattern(
        regexp = "^[\\u4e00-\\u9fa5_a-zA-Z0-9]{0,128}$",
        message = "描述长度在0-128之间, 仅支持中文英文字母数字下划线")
    private String themeDesc;

    /*所属层级*/
    @Schema(description = "上级主题id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long pid;
}
